package com.afterglow.example.consumer;

import com.afterglow.example.common.model.User;
import com.afterglow.example.common.service.UserService;
import com.afterglow.lcsrpc.proxy.ServiceProxyFactory;

/**
 * Description: 简易服务消费者示例
 * Date: 2024/12/08
 * author: lcs
 */
public class EasyConsumerExample {

    public static void main(String[] args) {
        // 动态代理
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("lcs");
        //调用
        User newUser = userService.getUser(user);
        if (newUser != null){
            System.out.println(newUser.getName());
        }else {
            System.out.println("user == null");
        }
    }
}
